const { Model, DataTypes } = require('sequelize');

const sequelize = require('./database');

/*
比赛表，和project比赛项目表，以及staffgroup组别表之间存在一对多的关系
 */
class Match extends Model {}

Match.init({
  title: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: true
  },
  deadline: {
    type: DataTypes.DATE,
    allowNull: false,
    unique: false
  },
  telephone: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: false
  },
  mem: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: false
  },
  disabled: {
    type: DataTypes.INTEGER,
    allowNull: false,
    defaultValue:0
  }
}, {
  sequelize,
  modelName: 'match'
});

module.exports = Match;